# Copyright (C) 2005 Taylor L. Riché <riche@cs.utexas.edu>
#  
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without 
# modifications, as long as this notice is preserved.
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
#	$Id: Makefile.am 132 2005-08-13 04:28:49Z richetl $	
#

AM_CXXFLAGS = -Wall -DLEE_BUILD -D_POSIX_PTHREAD_SEMANTICS
AM_LDFLAGS = -Wl,-export-dynamic

GGO_GEN =  cmdline.c cmdline.h
bin_PROGRAMS = lee
bin_SCRIPTS = lpkg
lee_SOURCES = main.cc cmdline.ggo $(GGO_GEN) \
              Reader.cc Reader.hh commands.hh \
              DynamicLib.hh ApplicationGraph.cc \
              ProcUnit.cc PlainFunctions.cc \
              PCon.cc  NetInterface.cc  \
              TraceInterface.cc  Scheduler.cc \
              FlowFunction.cc StatefulFunction.cc \
              CourierUnit.cc Context.cc Subscription.cc \
              lpkg.in
leedir = $(includedir)/lee
lee_HEADERS = ApplicationGraph.hh PPFunction.hh \
              FlowFunction.hh StatefulFunction.hh \
              ProcUnit.hh Synchronized.hh NetInterface.hh \
              TraceInterface.hh Scheduler.hh PCon.hh \
              PlainFunctions.hh SafeQueue.hh Event.hh \
              Subscription.hh Context.hh CourierUnit.hh

GGO=$(GENGETOPT)
GGOFLAGS=--unamed-opts="APP FILE" --file-name=cmdline
CLEANFILES = $(GGO_GEN) lpkg

$(GGO_GEN): cmdline.ggo
	$(GGO) $(GGOFLAGS) --input=$<

main.cc: $(GGO_GEN)

lpkg : lpkg.in
	sed -e"s/\#INCLUDE\#/$(subst /,\/,$(includedir))/g" < $< > lpkg


